Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@babel/plugin-syntax-import-assertions
Advanced tools
Allow parsing of the module assertion attributes in the import statement
The @babel/plugin-syntax-import-assertions package allows Babel to parse the import assertions syntax, which is a feature that enables developers to make assertions about the kind of content they are importing. This is particularly useful for ensuring that modules being imported are of the expected type, such as JSON, HTML, or other non-JavaScript resources.
Parsing import assertions
This feature allows Babel to understand and parse the import assertions syntax, which is used to assert the type of file being imported. In this code sample, an assertion is made that the imported module 'data.json' is of type 'json'.
import json from './data.json' assert { type: 'json' };
This package allows Babel to transform JSON string literals into actual JSON objects. It is similar to @babel/plugin-syntax-import-assertions in that it deals with JSON within the context of JavaScript modules, but it focuses on the transformation of JSON strings rather than the import assertions syntax.
Allow parsing of the module assertion attributes in the import statement
See our website @babel/plugin-syntax-import-assertions for more information.
Using npm:
npm install --save-dev @babel/plugin-syntax-import-assertions
or using yarn:
yarn add @babel/plugin-syntax-import-assertions --dev
v7.25.6 (2024-08-29)
babel-generator
babel-traverse
path.getAssignmentIdentifiers
may be undefined
(@liuxingbaoyu)babel-parser
babel-helpers
, babel-plugin-transform-optional-chaining
, babel-runtime-corejs3
superPropertyGet
helper (@nicolo-ribaudo)babel-generator
, babel-plugin-transform-async-to-generator
, babel-plugin-transform-block-scoping
, babel-plugin-transform-class-properties
, babel-plugin-transform-classes
, babel-plugin-transform-duplicate-named-capturing-groups-regex
, babel-plugin-transform-named-capturing-groups-regex
, babel-plugin-transform-react-jsx-development
, babel-plugin-transform-react-jsx
, babel-plugin-transform-react-pure-annotations
, babel-plugin-transform-regenerator
, babel-plugin-transform-runtime
, babel-preset-env
(
and comments (@nicolo-ribaudo)babel-plugin-syntax-import-assertions
, babel-plugin-syntax-import-attributes
babel-generator
babel-generator
parent
params in the generator (@nicolo-ribaudo)FAQs
Allow parsing of the module assertion attributes in the import statement
The npm package @babel/plugin-syntax-import-assertions receives a total of 12,999,492 weekly downloads. As such, @babel/plugin-syntax-import-assertions popularity was classified as popular.
We found that @babel/plugin-syntax-import-assertions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.